local setmetatable = setmetatable
local error        = error
module(...) -->name the package according to the filename

local vector3_mt = {
  __type = "vector3",
  __index = function(t,k) 
    return getmetatable(t)[k]
  end,
  __newindex = function (t,k,v)
    error("attempt to set a non valid field", 2)
  end
}

new = function(x,y,z)
  local v = {}
  v.x = x or 0
  v.y = y or 0
  v.z = z or 0
  setmetatable(v,vector3_mt) 
  return v
end
